<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('结余经费管理')" />
</head>
<body class="gray-bg">
<div>

    <div class="container-div">
        <div class="row" >

            <!--登录信息-->
            <input name="userid" th:value="${session.userid}" type="hidden" id="userid">
            <input name="username" th:value="${session.username}" type="hidden" id="username">
            <input name="deptid" th:value="${session.deptid}" type="hidden" id="deptid">
            <input name="parentid" th:value="${parentid}" type="hidden" id="parentid">
            <input name="jigoujibie" th:value="${session.jigoujibie}" type="hidden" id="jigoujibie">

            <div class="tabs-container" style="margin-top:20px;">
                <ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">结余经费管理</a>
                    </li>
                    <li id="tuihuitab" class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">结余经费退回</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">结余经费收款</a>
                    </li>
                </ul>

                <div class="tab-content">

                    <!--结余经费管理-->
                    <div id="tab-1" class="tab-pane active">
                        <div class="panel-body" id="jieyujingfeiguanli">

                            <div v-if="deptid!='000'&&(parentid==null||parentid=='')" class="col-sm-12 select-table" style="margin-top:0px;padding-top: 20px;">

                                <div class="col-sm-4">
                                    <div class="panel panel-primary">
                                        <div class="panel-heading" style="font-size: 18px;font-weight: bold">
                                            总经费
                                        </div>
                                        <div class="panel-body" style="text-align: center">
                                            <h1 class="fa" style="font-weight: bold;font-size:30px;">{{yue.zongjingfei}}</h1>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-4">
                                    <div class="panel panel-success">
                                        <div class="panel-heading" style="font-size: 18px;font-weight: bold">
                                            待发经费
                                        </div>
                                        <div class="panel-body" style="text-align: center">
                                            <h1 class="fa" style="font-weight: bold;font-size:30px;">{{yue.daifajingfei}}</h1>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-4">
                                    <div class="panel panel-danger">
                                        <div class="panel-heading" style="font-size: 18px;font-weight: bold">
                                            结余经费
                                        </div>
                                        <div class="panel-body" style="text-align: center">
                                            <h1 class="fa" style="font-weight: bold;font-size:30px;">{{yue.jieyujingfei}}</h1>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="col-sm-12 select-table table-striped">
                                <table id="bootstrap-table" class="table-bordered table-hover table-striped table" style="text-align: center;">
                                    <tr style="font-weight: bold;">
                                        <td>序号</td>
                                        <td>特贴单位</td>
                                        <td>余额(元)</td>
                                        <td>结余经费(元)</td>
                                        <td>操作</td>
                                    </tr>
                                    <tr v-for="(yueitem,index) in yuelist" v-if="yuelist.length > 0">
                                        <td style="vertical-align: middle; text-align: center;" v-text="index+1"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="yueitem.deptname"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-if="yueitem.zongjingfei==null">0</td>
                                        <td style="vertical-align: middle; text-align: center;" v-else v-text="yueitem.zongjingfei"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-if="yueitem.jieyujingfei==null">0</td>
                                        <td style="vertical-align: middle; text-align: center;" v-else v-text="yueitem.jieyujingfei"></td>
                                        <td style="vertical-align: middle; text-align: center;">
                                            <button v-if="yueitem.deptlevel!=3" class="btn btn-md btn-success"
                                                    @click="toCustomYueList(yueitem)">下级单位
                                            </button>
                                            <button class="btn btn-md btn-info"
                                                    @click="toSendMessage(yueitem)">发送短信提醒
                                            </button>
                                        </td>
                                    </tr>
                                </table>

                            </div>

                            <div th:replace="system/jintieguanli/modal_message::message"></div>
                        </div>
                    </div>

                    <div id="tab-2" class="tab-pane">
                        <div class="panel-body" id="jieyujingfeituihui">
                            <!--退钱-->
                            <div id="toolbar" role="group" style="padding-top:10px;">
                                <button class="btn btn-primary btn-md dim"  @click="toTuikuan"
                                        style="margin-top:10px;">发起退款
                                </button>
                            </div>
                            <div class="col-sm-12 select-table table-striped">
                                <table id="bootstrap-table" class="table-hover table-striped table" style="text-align: center;">
                                    <tr style="font-weight: bold;">
                                        <td>序号</td>
                                        <td>退款总金额</td>
                                        <td>退款说明</td>
                                        <td>退款时间</td>
                                        <td>上级单位是否收款</td>
                                        <td>上级单位收款时间</td>
                                        <td>操作</td>
                                    </tr>
                                    <tr v-for="(tuikuanitem,index) in tuikuanlist" v-if="tuikuanlist.length > 0">
                                        <td style="vertical-align: middle; text-align: center;" v-text="index+1"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="tuikuanitem.zongjine"></td>
                                        <td style="vertical-align: middle; text-align: center;"
                                            v-text="tuikuanitem.tuituanyuanyin"></td>
                                        <td style="vertical-align: middle; text-align: center;"
                                            v-text="tuikuanitem.tuikuanshijian"></td>
                                        <td style="vertical-align: middle; text-align: center;"
                                            :class="tuikuanitem.isshoudao==1?'green':'red'"
                                            v-text="tuikuanitem.isshoudao==1?'已收款':'未收款'"></td>
                                        <td style="vertical-align: middle; text-align: center;"
                                            v-text="tuikuanitem.shoudaoshijian"></td>
                                        <td style="vertical-align: middle; text-align: center;">
                                            <button  class="btn btn-primary btn-md"
                                                     @click="toChakan(tuikuanitem.id)">查看
                                            </button>
                                        </td>
                                    </tr>
                                    <tr v-if="tuikuanlist.length == 0">
                                        <td style="text-align: center; vertical-align: middle" colspan="9">查无数据</td>
                                    </tr>
                                </table>

                                <div v-if="recordCount2 != '0'" class="my-page-navigation" style="text-align:center;">
                                    <button class="btn btn-default" @click="firstPage2">首页</button>
                                    <button class="btn btn-default" @click="prePage2">上一页</button>
                                    <select class="custom-select border-secondary" v-model="pagesize2">
                                        <option value="10">10 条/页</option>
                                        <option value="20">20 条/页</option>
                                        <option value="30">30 条/页</option>
                                        <option value="50">50 条/页</option>
                                    </select>
                                    <span v-text="pageindex2 + '  /  ' + pageCount2" style="border-color: #6c757d"></span>
                                    <span v-text="'共' + recordCount2 + '条'" style="border-color: #6c757d"></span>
                                    <button class="btn btn-default" @click="nextPage2">下一页</button>
                                    <button class="btn btn-default" @click="lastPage2">尾页</button>
                                    <span style="border-color: #6c757d">跳到第</span>
                                    <input type="text" class="form-control border-secondary" style="width:50px;display:inline;"
                                           v-model="targetpage2" @keyup.enter="targetPage2">
                                    <span style="border-color: #6c757d">页</span>
                                    <button class="btn btn-default" @click="targetPage2">跳</button>
                                </div>
                            </div>
                            <!-- 新增退款 -->
<!--                            <div th:replace="system/jingfeipici/modal_shoukuanxiangqing::shoukuanxiangqing"></div>-->
                            <div th:replace="system/jintieguanli/modal_chakantuikuan::chakan"></div>
                            <!--<div th:replace="system/jintieguanli/modal_chakanjieyu::chakan"></div>-->

                        </div>
                    </div>

                    <div id="tab-3" class="tab-pane">
                        <div class="panel-body" id="jieyujingfeishoukuan">
                            <!--收钱-->

                            <div class="col-sm-12 search-collapse">
                                <form id="formId">
                                    <div class="select-list">
                                        <ul>
                                            <li>
                                                <label>收款状态&nbsp;&nbsp;</label>
                                                <select class="form-control" v-model="shoukuanzhuangtai">
                                                    <option value="0">未收款</option>
                                                    <option value="1">已收款</option>
                                                </select>
                                            </li>
                                            <li>
                                                <label>单位名称&nbsp;&nbsp;</label>
                                                <input type="text" name="deptName" v-model="deptName"/>
                                            </li>
                                            <li>
                                                <label>退款时间&nbsp;&nbsp;</label>
                                                <input type="text" class="" placeholder="请选择退款开始日期" name="tktime" id="tktime1" v-model="tktime1" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'tktime2\')}'})"  @blur="getDate_tk"/>
                                                <input type="text" class="" placeholder="请选择退款结束日期" name="tktime" id="tktime2" v-model="tktime2" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'tktime1\')}'})"  @blur="getDate_tk"/>
                                            </li>
                                            <li class="sousuo">
                                                <a class="btn btn-success btn-md" @click="bindTuikuanList"><i
                                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                                <a class="btn btn-warning btn-md" @click="reset()"><i
                                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                                            </li>
                                        </ul>
                                    </div>
                                </form>
                            </div>

<!--                            <div id="toolbar" role="group" style="padding-top:10px;">
                                <button class="btn btn-rounded btn-primary btn-md" :disabled="shoukuanzhuangtai!=0" @click="toShoukuan"
                                        style="margin-top:10px;">批量收款
                                </button>
                            </div>-->
                            <div class="col-sm-12 select-table table-striped">
                                <table id="bootstrap-table" class="table-hover table-striped table" style="text-align: center;">
                                    <tr style="font-weight: bold;">
                                        <!--<td v-if="shoukuanzhuangtai=='0'" style="text-align: center; vertical-align: middle;"><input
                                                @click="checkAll" style="margin-right: 10px" type="checkbox" id="allAndNotAll"/>选择
                                        </td>-->
                                        <td>序号</td>
                                        <td>退款单位</td>
                                        <td>退款总金额(元)</td>
                                        <td>退款说明</td>
                                        <td>退款时间</td>
                                        <td v-if="shoukuanzhuangtai!='0'">收款时间</td>
                                        <td style="text-align: center; vertical-align: middle;">操作</td>
                                    </tr>
                                    <tr v-for="(tuikuanitem,index) in tuikuanlist" v-if="tuikuanlist.length > 0">
                                        <!--<td v-if="shoukuanzhuangtai=='0'" style="vertical-align: middle; text-align: center;"><input
                                                @click="checkOne" type="checkbox" name="checkbox" :value="tuikuanitem.id"/></td>-->
                                        <td style="vertical-align: middle; text-align: center;" v-text="index+1"></td>
                                        <td style="vertical-align: middle; text-align: center;"
                                            v-text="tuikuanitem.deptname"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="tuikuanitem.zongjine"></td>
                                        <td style="vertical-align: middle; text-align: center;"
                                            v-text="tuikuanitem.tuituanyuanyin"></td>
                                        <td style="vertical-align: middle; text-align: center;"
                                            v-text="tuikuanitem.tuikuanshijian"></td>
                                        <td v-if="shoukuanzhuangtai!='0'" style="vertical-align: middle; text-align: center;"
                                            v-text="tuikuanitem.shoudaoshijian"></td>
                                        <td style="vertical-align: middle; text-align: center;">
                                            <button v-if="shoukuanzhuangtai=='0'" class="btn btn-success btn-md"
                                                    @click="Shoukuan(tuikuanitem.id)">收款
                                            </button>
                                            <button  class="btn btn-primary btn-md"
                                                     @click="toChakan(tuikuanitem.id)">查看
                                            </button>
                                        </td>
                                    </tr>
                                </table>

                                <div v-if="recordCount != '0'" class="my-page-navigation" style="text-align:center;">
                                    <button class="btn btn-default" @click="firstPage">首页</button>
                                    <button class="btn btn-default" @click="prePage">上一页</button>
                                    <select class="custom-select border-secondary" v-model="pagesize">
                                        <option value="10">10 条/页</option>
                                        <option value="20">20 条/页</option>
                                        <option value="30">30 条/页</option>
                                        <option value="50">50 条/页</option>
                                    </select>
                                    <span v-text="pageindex + '  /  ' + pageCount" style="border-color: #6c757d"></span>
                                    <span v-text="'共' + recordCount + '条'" style="border-color: #6c757d"></span>
                                    <button class="btn btn-default" @click="nextPage">下一页</button>
                                    <button class="btn btn-default" @click="lastPage">尾页</button>
                                    <span style="border-color: #6c757d">跳到第</span>
                                    <input type="text" class="form-control border-secondary" style="width:50px;display:inline;"
                                           v-model="targetpage" @keyup.enter="targetPage">
                                    <span style="border-color: #6c757d">页</span>
                                    <button class="btn btn-default" @click="targetPage">跳</button>
                                </div>
                            </div>
                            <!--<div th:replace="system/tuikuan/modal_piliangshoukuan::piliangshoukuan"></div>-->
                            <div th:replace="system/jintieguanli/modal_chakantuikuan2::chakan"></div>


                        </div>
                    </div>

                </div>

            </div>

        </div>
    </div>
</div>

<th:block th:include="include :: footer" />
<script th:src="@{/js/system/jintieguanli/jieyujingfeiguanli.js?v=1.0}"></script>
<script th:src="@{/js/system/jintieguanli/jieyujingfeituihui.js?v=1.0}"></script>
<script th:src="@{/js/system/jintieguanli/jieyujingfeishoukuan.js?v=1.0}"></script>

</body>
</html>

<style>
    .red{
        color: red;
    }
    .green{
        color: green;
    }
</style>